/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-02-01
 * Time: 12:29
 */

class Dog{
    //属性->成员变量(或 字段)
    public String name;  //名字
    public String color; //颜色

    //行为->成员方法
    public void bark(){
        System.out.println(name+"汪汪叫!");
    }
    public void wag(){
        System.out.println(name+"摇尾巴!");
    }
}


public class Classes {
    public static void main(String[] args) {
        //实例化一个Dog对象
        Dog dog1=new Dog();
        dog1.name="来福";
        dog1.color="黑色";
        System.out.println(dog1.name);
        System.out.println(dog1.color);
        dog1.bark();
        dog1.wag();
        //通过一个类，可以实例化无数个对象
        Dog dog2=new Dog();
        Dog dog3=new Dog();
        Dog dog4=new Dog();
        Dog dog5=new Dog();
    }
}
